package br.mil.eb.decex.ati.ordemservico;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.mil.eb.decex.ati.material.Material;
import br.mil.eb.decex.ati.ordemservico.OrdemServico;
import br.mil.eb.decex.ati.usuario.Usuario;

@Entity
@Table(name= "ordemservico")
public class OrdemServico {
			
	@Id
	@GeneratedValue	
	@Column(name= "os_codigo")
	private Integer id;
	
	@Column(name= "os_ano")
	private Date ano;
	
	
	@ManyToOne
	@JoinColumn(name= "mat_codigo", nullable=false)
	private Material material;
	
	@ManyToOne
	@JoinColumn(name= "usu_codigo", nullable=false)
	private Usuario usuario;
	
	@Column(name= "os_dataentr")
	private Date dataEntrada;
	
	@Column(name= "os_datasai")
	private Date dataSaida;
	
	
public OrdemServico(){
		
	}

	public OrdemServico(Material material, Usuario usuario) {
		this.usuario = usuario;
		this.material = material;
	}


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getAno() {
		return ano;
	}

	public void setAno(Date ano) {
		this.ano = ano;
	}

	public Material getMaterial() {
		return material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}

	public Usuario getUsuario() {
		return usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	public Date getDataEntrada() {
		return dataEntrada;
	}

	public void setDataEntrada(Date dataEntrada) {
		this.dataEntrada = dataEntrada;
	}

	public Date getDataSaida() {
		return dataSaida;
	}

	public void setDataSaida(Date dataSaida) {
		this.dataSaida = dataSaida;
	}	

}
